using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace RBAC.Domain.SalesManage
{
    /// <summary>
    /// 退货物料类
    /// </summary>
    [Table("ReturnMaterials")]
    public class ReturnMaterials : BaseEntity
    {
        /// <summary>
        /// 销售单号
        /// </summary>
        [StringLength(50)]
        public string? SalesOrderNumber { get; set; }

        /// <summary>
        /// 发货单号
        /// </summary>
        [StringLength(50)]
        public string? ReturnOrderNumber { get; set; }

        /// <summary>
        /// 物料编码
        /// </summary>
        [StringLength(50)]
        public string? MaterialCode { get; set; }

        /// <summary>
        /// 物料名称
        /// </summary>
        [StringLength(100)]
        public string? MaterialName { get; set; }

        /// <summary>
        /// 型号规格
        /// </summary>
        [StringLength(100)]
        public string? Specification { get; set; }

        /// <summary>
        /// 主计量
        /// </summary>
        [StringLength(20)]
        public string? Unit { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public int? Quantity { get; set; }

        /// <summary>
        /// 入库数量
        /// </summary>
        public int? StockInQuantity { get; set; }

        /// <summary>
        /// 批号
        /// </summary>
        [StringLength(50)]
        public string? BatchNumber { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        [StringLength(200)]
        public string? Remark { get; set; }

        /// <summary>
        /// 退货通知单ID
        /// </summary>
        public long? ReturnNoticeId { get; set; }

        /// <summary>
        /// 关联的退货通知单
        /// </summary>
        [ForeignKey("ReturnNoticeId")]
        public virtual ReturnNotice? ReturnNotice { get; set; }
    }
}
